package com.heriparid.slideshow.adapters;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import com.heriparid.slideshow.paging.PageContainer;
import com.heriparid.slideshow.paging.PageManager;

public class ImageSlideAdapter extends PagerAdapter {

	@Override
	public int getItemPosition(Object object) {
		return POSITION_NONE;
	}		
	
	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		container.removeView((View) object);
	}
	
	@Override
	public int getCount() {			
		return 3;
	}

	@Override
	public Object instantiateItem(ViewGroup container, int position) {
		PageContainer currentPage = PageManager.PAGE_CONTAINER[position];
		container.addView(currentPage.view);		
		return currentPage.view;
	}

	@Override
	public boolean isViewFromObject(View view, Object obj) {
		return view == obj;
	}		
}
